package zsc.ruanc.practicaltraining.mapper;

import zsc.ruanc.practicaltraining.model.domain.TStatistic;
import zsc.ruanc.practicaltraining.model.vo.adminStatisticVo;

import java.util.List;

/**
 * 统计表SQL
 */
public interface StatisticMapper {

    /**
     * 插入文章统计表
     * @param articleId
     * @return
     */
    public int insert(int articleId);

    public int hitsAndOne(int articleId);
    public int hitsCutOne(int articleId);

    public int commentsAndOne(int articleId);
    public int commentsCutOne(int articleId);

    public int likesAndOne(int articleId);
    public int likesCutOne(int articleId);

    public TStatistic select(int articleId);

    /**
     * 返回排名前 num 的文章序号
     * @param row
     * @param orderByColumnName 排序条件
     * @return
     */
    public List<TStatistic> TopList(String orderByColumnName, int row);

    //--------管理员权限--------------------

    /**
     * 更改统计数值
     * @param vo
     * @return
     */
    public int updateCount(TStatistic vo);

}
